from __future__ import annotations

from dataclasses import dataclass


@dataclass
class CrossingSize:
    required_height_m: float
    width_m: float
    span_m: float
    note: str


def compute_crossing_size(clearance_m: float, dynamic_allowance_m: float, width_m: float, span_m: float) -> CrossingSize:
    """跨越架尺寸：高度=净空+动态附加；宽度与跨距由现场条件给定。"""

    H = clearance_m + dynamic_allowance_m
    return CrossingSize(required_height_m=H, width_m=width_m, span_m=span_m, note="按最小净空+附加量")


